home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / OS / FWGraphx / Include / FWPicShp.h < prev    next >
Encoding:
Text File  |  1994-04-21  |  3.2 KB  |  114 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWPicShp.h
  4. //    Release Version:    $ 1.0d1 $
  5. //
  6. //    Creation Date:        4/13/94
  7. //
  8. //    Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef FWPICSHP_H
  13. #define FWPICSHP_H
  14.  
  15. #ifndef FWSHAPE_H
  16. #include "FWShape.h"
  17. #endif
  18.  
  19. #ifndef FWBNDSHP_H
  20. #include "FWBndShp.h"
  21. #endif
  22.  
  23. //========================================================================================
  24. //    •• Forward Declarations
  25. //========================================================================================
  26.  
  27. class FW_CGraphicContext;
  28. class FW_CPictShapeRep;
  29. class FW_CBitmapShape;
  30.  
  31. //========================================================================================
  32. //    •• CLASS FW_CPictShape
  33. //========================================================================================
  34.  
  35. class FW_CPictShape : public FW_CShape
  36. {
  37. //----------------------------------------------------------------------------------------
  38. //    • Constructors
  39. //
  40. public:
  41.     FW_CPictShape();
  42.     FW_CPictShape(FW_PlatformPict platformPict);
  43.     FW_CPictShape(FW_PlatformPict platformPict, const FW_CRect& rect);
  44.  
  45.     FW_CPictShape(FW_CPictShapeRep* rep);
  46.     FW_CPictShape(const FW_CPictShape& other);
  47.  
  48. //----------------------------------------------------------------------------------------
  49. //    • Operators
  50. //
  51. public:
  52.     FW_CPictShape& operator=(const FW_CPictShape& other);    
  53.     FW_CPictShape& operator=(FW_CPictShapeRep* other);    
  54.     
  55.     FW_CPictShapeRep* operator->() const
  56.                 {return (FW_CPictShapeRep*)GetRep();}
  57.  
  58. //----------------------------------------------------------------------------------------
  59. //    • Conversion
  60. //
  61.     operator FW_CBitmapShape() const;
  62. };
  63.  
  64. //========================================================================================
  65. //    •• class FW_CPictShapeRep
  66. //========================================================================================
  67.  
  68. class FW_CPictShapeRep : public FW_CBoundedShapeRep
  69. {
  70.     friend class FW_CPictShape;
  71.     
  72. //----------------------------------------------------------------------------------------
  73. //    • Constructors/Destructors
  74. //
  75. protected:
  76.     FW_CPictShapeRep();
  77.     FW_CPictShapeRep(FW_PlatformPict platformPict, const FW_CRect& rect);
  78.     
  79.     virtual ~FW_CPictShapeRep();
  80.     
  81. //---------------------------------------------------------------------------------------
  82. //    • Inherited API
  83. //
  84. public:
  85.     // ----- Hit Test -----
  86.     FW_HitTestPart         HitTest(const FW_CPoint& test) const;
  87.  
  88.     // ----- Rendering -----
  89.     virtual void         Draw(FW_CGraphicContext* graphicContext);
  90.     
  91.     // ----- Default shape -----
  92.     virtual void         SetAsDefault() const;
  93.  
  94.     // ----- Stream -----
  95.     virtual void        Flatten(FW_CWritableStream& stream);
  96.     virtual void        Unflatten(FW_CReadableStream& stream);
  97.  
  98. //---------------------------------------------------------------------------------------
  99. //    • New API
  100. //
  101. public:
  102.     FW_CPictShape        Copy() const;
  103.     
  104.     FW_PlatformPict        GetPlatformPict() const
  105.                             {return fPlatformPict;}
  106.     void                SetPlatformPict(FW_PlatformPict platformPict);
  107.     
  108. //---------------------------------------------------------------------------------------
  109. //    • Data Member
  110. //    
  111.     FW_PlatformPict     fPlatformPict;
  112. };
  113.                 
  114. #endif